<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>5525 - 青春活力的家</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <style>
        /* 定义 CSS 变量 */
        :root {
            --primary-color: #0099ff;
            --secondary-color: #ffcc00;
            --text-color: #333;
            --background-color: #f4f4f4;
            --card-background: white;
            --shadow-color: rgba(0, 0, 0, 0.1);
            --base-font-size: 18px;
            /* 基础字体大小 */
            --success-color: #28a745;
            --error-color: #dc3545;
        }

        /* 全局样式 */
        body {
            font-family: 'Comic Sans MS', cursive, Arial, sans-serif;
            margin: 0;
            padding: 0;
            line-height: 1.6;
            background-color: var(--background-color);
            color: var(--text-color);
            font-size: var(--base-font-size);
            /* 设置全局字体大小 */
        }

        header {
            background-color: var(--primary-color);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
            box-shadow: 0 2px 5px var(--shadow-color);
        }

        .logo {
            display: flex;
            align-items: center;
        }

        .logo img {
            width: 60px;
            height: 60px;
            margin-right: 10px;
            animation: rotateLogo 5s infinite linear;
        }

        @keyframes rotateLogo {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        .logo h1 {
            font-size: calc(var(--base-font-size) * 1.8);
            /* 增大标题字体大小 */
            color: var(--secondary-color);
            margin: 0;
        }

        .logo h3 {
            font-size: calc(var(--base-font-size) * 1.2);
            /* 增大副标题字体大小 */
            margin: 0;
        }

        nav ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            display: flex;
        }

        nav ul li {
            position: relative;
        }

        nav ul li a {
            display: block;
            color: white;
            text-align: center;
            padding: 14px 16px;
            text-decoration: none;
            transition: background-color 0.3s ease;
            font-size: var(--base-font-size);
            /* 设置导航链接字体大小 */
        }

        nav ul li a:hover {
            background-color: #0077cc;
        }

        .dropdown {
            display: none;
            position: absolute;
            background-color: white;
            min-width: 160px;
            box-shadow: 0px 8px 16px 0px var(--shadow-color);
            z-index: 1;
            border-radius: 5px;
        }

        .dropdown li a {
            color: var(--text-color);
            padding: 12px 16px;
            text-decoration: none;
            display: block;
            text-align: left;
            transition: background-color 0.3s ease;
            font-size: var(--base-font-size);
            /* 设置下拉菜单链接字体大小 */
        }

        .dropdown li a:hover {
            background-color: #f4f4f4;
        }

        nav ul li:hover .dropdown {
            display: block;
        }

        .search-box {
            display: flex;
        }

        .search-box input[type="text"] {
            padding: 6px;
            border: none;
            border-radius: 4px 0 0 4px;
            font-size: var(--base-font-size);
            /* 设置搜索框字体大小 */
        }

        .search-box button {
            padding: 6px 10px;
            background: #ddd;
            border: none;
            border-radius: 0 4px 4px 0;
            cursor: pointer;
            font-size: var(--base-font-size);
            /* 设置搜索按钮字体大小 */
        }

        .group-photo img {
            width: 100%;
            height: auto;
            margin-bottom: 20px;
            box-shadow: 0 2px 5px var(--shadow-color);
            object-fit: cover;
        }

        main {
            padding: 20px;
            background-color: var(--card-background);
            box-shadow: 0 2px 5px var(--shadow-color);
            border-radius: 5px;
            margin: 20px;
        }

        .intro-challenge-container {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }

        .intro,
        .challenge {
            flex: 1;
            background-color: var(--card-background);
            box-shadow: 0 2px 5px var(--shadow-color);
            border-radius: 5px;
            padding: 20px;
        }

        .intro-content h2,
        .challenge h2,
        .news h2,
        .moments h2,
        .links h2 {
            border-bottom: 2px solid var(--primary-color);
            padding-bottom: 10px;
            color: var(--text-color);
            font-size: calc(var(--base-font-size) * 1.5);
            /* 增大标题字体大小 */
        }

        .timeline li {
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            font-size: var(--base-font-size);
            /* 设置时间线项目字体大小 */
        }

        .timeline .date {
            font-weight: bold;
            margin-right: 10px;
            color: var(--primary-color);
            font-size: var(--base-font-size);
            /* 设置时间线日期字体大小 */
        }

        .links ul {
            list-style-type: none;
            padding: 0;
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }

        .links ul li {
            margin-bottom: 0;
        }

        .links ul li a {
            color: var(--primary-color);
            text-decoration: none;
            font-size: var(--base-font-size);
            /* 设置友情链接字体大小 */
        }

        .links ul li a:hover {
            text-decoration: underline;
        }

        footer {
            background-color: var(--primary-color);
            color: white;
            padding: 20px;
            text-align: center;
            box-shadow: 0 -2px 5px var(--shadow-color);
        }

        .footer-menu {
            list-style-type: none;
            padding: 0;
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
        }

        .footer-menu li {
            position: relative;
        }

        .footer-menu li a {
            color: white;
            text-decoration: none;
            padding: 0 15px;
            font-size: var(--base-font-size);
            /* 设置底部菜单链接字体大小 */
        }

        .footer-menu li a:hover {
            text-decoration: underline;
        }

        .footer-menu .dropdown {
            display: none;
            position: absolute;
            background-color: white;
            min-width: 160px;
            box-shadow: 0px 8px 16px 0px var(--shadow-color);
            z-index: 1;
            border-radius: 5px;
            bottom: 100%;
            left: 0;
        }

        .footer-menu .dropdown li a {
            color: var(--text-color);
            padding: 12px 16px;
            text-decoration: none;
            display: block;
            text-align: left;
            transition: background-color 0.3s ease;
            font-size: var(--base-font-size);
            /* 设置底部菜单下拉链接字体大小 */
        }

        .footer-menu .dropdown li a:hover {
            background-color: #f4f4f4;
        }

        .footer-menu li:hover .dropdown {
            display: block;
        }

        .footer-contact {
            margin-bottom: 20px;
            font-size: var(--base-font-size);
            /* 设置底部联系方式字体大小 */
        }

        .footer-copyright {
            font-size: calc(var(--base-font-size) * 0.9);
            /* 减小版权信息字体大小 */
        }

        /* 图片轮播样式 */
        .slider {
            height: 800px;
            background-color: #f0f0f0;
            text-align: center;
            line-height: 600px;
            position: relative;
            overflow: hidden;
        }

        .slider img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            position: absolute;
            top: 0;
            left: 0;
            opacity: 0;
            transition: opacity 1s ease;
        }

        .slider img.active {
            opacity: 1;
        }

        .prev,
        .next {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            padding: 10px;
            border: none;
            cursor: pointer;
            z-index: 10;
        }

        .prev {
            left: 10px;
        }

        .next {
            right: 10px;
        }

        /* 默契大挑战样式 */
        .challenge {
            text-align: center;
        }

        .challenge h2 {
            color: var(--primary-color);
        }

        .challenge p {
            font-size: 1.1em;
            margin-bottom: 15px;
        }

        .challenge input[type="text"] {
            width: 70%;
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 5px;
            outline: none;
            transition: border-color 0.3s ease;
            font-size: var(--base-font-size);
        }

        .challenge input[type="text"]:focus {
            border-color: var(--primary-color);
        }

        .challenge button {
            background-color: var(--primary-color);
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
            font-size: var(--base-font-size);
        }

        .challenge button:hover {
            background-color: #0077cc;
        }

        .challenge #result {
            margin-top: 15px;
            font-size: 1.1em;
            font-weight: bold;
        }

        .challenge #result.correct {
            color: var(--success-color);
        }

        .challenge #result.incorrect {
            color: var(--error-color);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            header {
                flex-direction: column;
                align-items: flex-start;
            }

            nav ul {
                flex-direction: column;
            }

            nav ul li {
                width: 100%;
            }

            .search-box {
                width: 100%;
                margin-top: 10px;
            }

            .search-box input[type="text"] {
                width: 100%;
            }

            .footer-menu {
                flex-direction: column;
            }

            .footer-menu li {
                margin-bottom: 10px;
            }

            .intro-challenge-container {
                flex-direction: column;
            }
        }

        .member {
            display: inline-block;
            width: 30%;
            margin: 1%;
            text-align: center;
        }

        .member img {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            object-fit: cover;
            margin-bottom: 10px;
        }

        .member h3 {
            margin: 0;
            font-size: 18px;
        }

        .member p {
            margin: 5px 0;
            font-size: 14px;
            color: #7f8c8d;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }

        table th,
        table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }

        table th {
            background-color: #0099ff;
            color: white;
        }

        .like-btn {
            background-color: #0099ff;
            color: white;
            border: none;
            padding: 5px 10px;
            cursor: pointer;
        }

        .comment-section {
            margin-top: 10px;
        }

        .comment-input {
            width: 80%;
            padding: 5px;
            margin-right: 5px;
        }

        .comment-btn {
            background-color: #0099ff;
            color: white;
            border: none;
            padding: 5px 10px;
            cursor: pointer;
        }

        .comments {
            margin-top: 10px;
        }

        .comment {
            background-color: #f0f0f0;
            padding: 5px;
            margin-bottom: 5px;
            position: relative;
        }

        .delete-comment-btn {
            position: absolute;
            top: 50%;
            right: 5px;
            transform: translateY(-50%);
            background-color: #dc3545;
            color: white;
            border: none;
            padding: 2px 5px;
            cursor: pointer;
            display: none;
        }

        .comment:hover .delete-comment-btn {
            display: block;
        }
    </style>
</head>

<body>
    <!-- 头部 -->
    <header>
        <div class="logo">
            <img src="img/宿舍logo.jpg" alt="宿舍 Logo">
            <h1>5525</h1>
            <h3>一个青春活力的家</h3>
        </div>
        <nav>
            <ul>
                <li><a href="index.html">首页</a></li>
                <li>
                    <a href="%E5%AE%BF%E8%88%8D%E6%88%90%E5%91%98.html">宿舍成员</a>
                    <ul class="dropdown">
                        <li><a href="#">成员组成</a></li>
                        <li><a href="#">值日表</a></li>
                    </ul>
                </li>
                <li>
                    <a href="%E5%AE%BF%E8%88%8D%E7%94%9F%E6%B4%BB.html">宿舍生活</a>
                    <ul class="dropdown">
                        <li><a href="#">每日小知识</a></li>
                        <li><a href="#">宿舍公约</a></li>
                        <li><a href="#">生活小贴士</a></li>
                        <li><a href="#">互动板块</a></li>
                    </ul>
                </li>
                <li>
                    <a href="%E5%AE%BF%E8%88%8D%E6%95%85%E4%BA%8B.html">宿舍故事</a>
                    <ul class="dropdown">
                        <li><a href="#">宿舍心愿墙</a></li>
                        <li><a href="#">难忘时刻</a></li>
                        <li><a href="#">宿舍未来</a></li>
                    </ul>
                </li>
                <li>
                    <a href="%E5%85%B3%E4%BA%8E%E6%88%91%E4%BB%AC.html">关于我们</a>
                    <ul class="dropdown">
                        <li><a href="#">活动投票</a></li>
                        <li><a href="#">留言板</a></li>
                        <li><a href="#">课程表</a></li>
                    </ul>
                </li>
            </ul>
        </nav>
        <div class="search-box">
            <input type="text" placeholder="搜索">
            <button><i class="fas fa-search"></i></button>
        </div>
    </header>

    <!-- 合照 -->
    <div class="group-photo">
        <img src="img/合照.jpg" alt="合照">
    </div>

    <!-- 主要内容区域 -->
    <main>
        <!-- 宿舍成员 -->
        <section id="members">
            <h2>宿舍成员</h2>
            <div class="member">
                <img src="img/宿舍成员/1号.jpg" alt="成员 1">
                <h3>梁定凯</h3>
                <p>床位：1号床</p>
                <p>家乡：海南海口</p>
                <p>兴趣爱好：编程、篮球</p>
                <p>个性签名：代码改变世界</p>
                <button class="like-btn" onclick="likeMember('梁定凯')">点赞 <span id="like-count-梁定凯">0</span></button>
                <div class="comment-section">
                    <input type="text" class="comment-input" id="comment-input-梁定凯" placeholder="写下你的评价">
                    <button class="comment-btn" onclick="addComment('梁定凯')">发表评论</button>
                </div>
                <div class="comments" id="comments-梁定凯"></div>
            </div>

            <div class="member">
                <img src="img/宿舍成员/2号.jpg" alt="成员 2">
                <h3>杨芳威</h3>
                <p>床位：2号床</p>
                <p>家乡：海南文昌</p>
                <p>兴趣爱好：摄影、跑步</p>
                <p>个性签名：用镜头记录生活</p>
                <button class="like-btn" onclick="likeMember('杨芳威')">点赞 <span id="like-count-杨芳威">0</span></button>
                <div class="comment-section">
                    <input type="text" class="comment-input" id="comment-input-杨芳威" placeholder="写下你的评价">
                    <button class="comment-btn" onclick="addComment('杨芳威')">发表评论</button>
                </div>
                <div class="comments" id="comments-杨芳威"></div>
            </div>
            <div class="member">
                <img src="img/宿舍成员/3号.jpg" alt="成员 3">
                <h3>郭起安</h3>
                <p>床位：3号床</p>
                <p>家乡：海南昌江</p>
                <p>兴趣爱好：理财、阅读</p>
                <p>个性签名：理财让生活更美好</p>
                <button class="like-btn" onclick="likeMember('郭起安')">点赞 <span id="like-count-郭起安">0</span></button>
                <div class="comment-section">
                    <input type="text" class="comment-input" id="comment-input-郭起安" placeholder="写下你的评价">
                    <button class="comment-btn" onclick="addComment('郭起安')">发表评论</button>
                </div>
                <div class="comments" id="comments-郭起安"></div>
            </div>
            <div class="member">
                <img src="img/宿舍成员/4号.jpg" alt="成员 4">
                <h3>陈星宏</h3>
                <p>床位：4号床</p>
                <p>家乡：海南昌江</p>
                <p>兴趣爱好：模型制作、绘画</p>
                <p>个性签名：创造属于自己的小世界</p>
                <button class="like-btn" onclick="likeMember('陈星宏')">点赞 <span id="like-count-陈星宏">0</span></button>
                <div class="comment-section">
                    <input type="text" class="comment-input" id="comment-input-陈星宏" placeholder="写下你的评价">
                    <button class="comment-btn" onclick="addComment('陈星宏')">发表评论</button>
                </div>
                <div class="comments" id="comments-陈星宏"></div>
            </div>
            <div class="member">
                <img src="img/宿舍成员/5号.jpg" alt="成员 5">
                <h3>秦敏彬</h3>
                <p>床位：5号床</p>
                <p>家乡：海南临高</p>
                <p>兴趣爱好：建筑模型搭建、爬山</p>
                <p>个性签名：用双手搭建梦想</p>
                <button class="like-btn" onclick="likeMember('秦敏彬')">点赞 <span id="like-count-秦敏彬">0</span></button>
                <div class="comment-section">
                    <input type="text" class="comment-input" id="comment-input-秦敏彬" placeholder="写下你的评价">
                    <button class="comment-btn" onclick="addComment('秦敏彬')">发表评论</button>
                </div>
                <div class="comments" id="comments-秦敏彬"></div>
            </div>
            <div class="member">
                <img src="img/宿舍成员/6号.jpg" alt="成员 6">
                <h3>陈维国</h3>
                <p>床位：6号床</p>
                <p>家乡：海南陵水</p>
                <p>兴趣爱好：打篮球、烹饪</p>
                <p>个性签名：篮球逐风，烟火暖人</p>
                <button class="like-btn" onclick="likeMember('陈维国')">点赞 <span id="like-count-陈维国">0</span></button>
                <div class="comment-section">
                    <input type="text" class="comment-input" id="comment-input-陈维国" placeholder="写下你的评价">
                    <button class="comment-btn" onclick="addComment('陈维国')">发表评论</button>
                </div>
                <div class="comments" id="comments-陈维国"></div>
            </div>
            <table>
                <thead>
                    <tr>
                        <th>日期</th>
                        <th>值日人员</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>周一</td>
                        <td>梁定凯</td>
                    </tr>
                    <tr>
                        <td>周二</td>
                        <td>杨芳威</td>
                    </tr>
                    <tr>
                        <td>周三</td>
                        <td>郭起安</td>
                    </tr>
                    <tr>
                        <td>周四</td>
                        <td>陈星宏</td>
                    </tr>
                    <tr>
                        <td>周五</td>
                        <td>秦敏彬</td>
                    </tr>
                    <tr>
                        <td>周六</td>
                        <td>陈维国</td>
                    </tr>
                    <tr>
                        <td>周日</td>
                        <td>全体大扫除</td>
                    </tr>
                </tbody>
            </table>
        </section>
    </main>

    <!-- 底部 -->
    <footer class="footer">
        <ul class="footer-menu">
            <li><a href="index.html">首页</a></li>
            <li>
                <a href="%E5%AE%BF%E8%88%8D%E6%88%90%E5%91%98.html">宿舍成员</a>
                <ul class="dropdown">
                    <li><a href="#">成员组成</a></li>
                    <li><a href="#">值日表</a></li>
                </ul>
            </li>
            <li>
                <a href="%E5%AE%BF%E8%88%8D%E7%94%9F%E6%B4%BB.html">宿舍生活</a>
                <ul class="dropdown">
                    <li><a href="#">每日小知识</a></li>
                    <li><a href="#">宿舍公约</a></li>
                    <li><a href="#">生活小贴士</a></li>
                    <li><a href="#">互动板块</a></li>
                </ul>
            </li>
            <li>
                <a href="%E5%AE%BF%E8%88%8D%E6%95%85%E4%BA%8B.html">宿舍故事</a>
                <ul class="dropdown">
                    <li><a href="#">宿舍心愿墙</a></li>
                    <li><a href="#">难忘时刻</a></li>
                    <li><a href="#">宿舍未来</a></li>
                </ul>
            </li>
            <li>
                <a href="%E5%85%B3%E4%BA%8E%E6%88%91%E4%BB%AC.html">关于我们</a>
                <ul class="dropdown">
                    <li><a href="#">活动投票</a></li>
                    <li><a href="#">留言板</a></li>
                    <li><a href="#">课程表</a></li>
                </ul>
            </li>
        </ul>
        <div class="footer-contact">
            <p>宿舍: 5525宿舍</p>
            <p>联系方式: dorm@example.com</p>
            <p>电话: 123-456-7890</p>
        </div>
        <div class="footer-copyright">
            <p>Copyright&copy;2025 5525宿舍版权所有</p>
        </div>
    </footer>

    <script>
        // 初始化点赞数和评论
        function initLikesAndComments() {
            const members = ['梁定凯', '杨芳威', '郭起安', '陈星宏', '秦敏彬', '陈维国'];
            members.forEach(member => {
                const likeCount = localStorage.getItem(`like-count-${member}`) || 0;
                const likeCountElement = document.getElementById(`like-count-${member}`);
                likeCountElement.textContent = likeCount;

                const comments = JSON.parse(localStorage.getItem(`comments-${member}`)) || [];
                const commentsDiv = document.getElementById(`comments-${member}`);
                comments.forEach(comment => {
                    const commentElement = document.createElement('div');
                    commentElement.classList.add('comment');
                    commentElement.textContent = comment;

                    const deleteButton = document.createElement('button');
                    deleteButton.classList.add('delete-comment-btn');
                    deleteButton.textContent = '删除';
                    deleteButton.addEventListener('click', () => {
                        deleteComment(member, comment, commentElement);
                    });
                    commentElement.appendChild(deleteButton);

                    commentsDiv.appendChild(commentElement);
                });
            });
        }

        // 点赞功能
        function likeMember(memberName) {
            const likeCountElement = document.getElementById(`like-count-${memberName}`);
            let likeCount = parseInt(likeCountElement.textContent);
            likeCount++;
            likeCountElement.textContent = likeCount;
            localStorage.setItem(`like-count-${memberName}`, likeCount);
        }

        // 添加评论功能
        function addComment(memberName) {
            const commentInput = document.getElementById(`comment-input-${memberName}`);
            const commentText = commentInput.value.trim();
            if (commentText && commentText.length <= 200) {
                const commentsDiv = document.getElementById(`comments-${memberName}`);
                const commentElement = document.createElement('div');
                commentElement.classList.add('comment');
                commentElement.textContent = commentText;

                const deleteButton = document.createElement('button');
                deleteButton.classList.add('delete-comment-btn');
                deleteButton.textContent = '删除';
                deleteButton.addEventListener('click', () => {
                    deleteComment(memberName, commentText, commentElement);
                });
                commentElement.appendChild(deleteButton);

                commentsDiv.appendChild(commentElement);

                const comments = JSON.parse(localStorage.getItem(`comments-${memberName}`)) || [];
                comments.push(commentText);
                localStorage.setItem(`comments-${memberName}`, JSON.stringify(comments));

                commentInput.value = '';
            } else {
                alert('评论不能为空且不能超过 200 字！');
            }
        }

        // 删除评论功能
        function deleteComment(memberName, commentText, commentElement) {
            const comments = JSON.parse(localStorage.getItem(`comments-${memberName}`)) || [];
            const newComments = comments.filter(comment => comment !== commentText);
            localStorage.setItem(`comments-${memberName}`, JSON.stringify(newComments));
            commentElement.remove();
        }

        // 页面加载时初始化
        window.onload = initLikesAndComments;
    </script>
</body>

</html>